package com.xinruke.hostels.systemmanage.controller;

import com.xinruke.hostels.common.controller.BaseController;
import com.xinruke.hostels.common.vo.ResultVO;
import com.xinruke.hostels.common.vo.query.RowsDataVO;
import com.xinruke.hostels.system.manage.interfaces.dto.*;
import com.xinruke.hostels.systemmanage.service.RoomStatusColorService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * @author yutaipu
 */
@RestController
@RequestMapping("/room-status-color")
@Api(tags = "房态颜色")
@Slf4j
public class RoomStatusColorController extends BaseController {

    @Autowired
    private RoomStatusColorService roomStatusColorService;

    @PostMapping(value = "/addDefault")
    @ApiOperation("添加酒店时调用，增加房态颜色的默认数据")
    public ResultVO addDefault(@RequestBody @Valid RoomStatusColorAddDefaultDTO params){
        return roomStatusColorService.addDefault(params);
    }


    @PostMapping(value = "/modify")
    @ApiOperation("修改")
    public ResultVO modify(@RequestBody @Valid RoomStatusColorModifyDTO params){
        return roomStatusColorService.modify(params);
    }

    @PostMapping(value = "/recover")
    @ApiOperation("恢复默认")
    public ResultVO recover(@RequestBody @Valid RoomStatusColorRecovercDTO params){
        return roomStatusColorService.recover(params);
    }

    @PostMapping(value = "/list")
    @ApiOperation(value = "查询房态颜色列表")
    public ResultVO<RowsDataVO<RoomStatusColorQueryResultDTO>> list(@Valid @RequestBody RoomStatusColorQueryListDTO params) {
        return roomStatusColorService.list(params);
    }

    @PostMapping(value = "/detail")
    @ApiOperation(value = "查询房态颜色详情")
    public ResultVO<RoomStatusColorQueryResultDTO> detail(@Valid @RequestBody RoomStatusColorDetailDTO params){
        return roomStatusColorService.detail(params);
    }

}


